package job.sm;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Scanner;

/**
 * Author: Zhang Dongwei
 * Date: 2023/7/29 15:57
 */
public class xm {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = null;
        List<Integer> list = new ArrayList<>();
        List<String> list1 = new ArrayList<>();
        while (sc.hasNextLine()){
            int flag = 0;
            int jz = 0;
            int bs = 0;
            s = sc.nextLine();
            if (s.equals("END")) break;
            for (int i = 0; i < s.length(); i++){
                if (s.charAt(i) == '#'){
                    flag = 1;
                    continue;
                }
                if (flag == 0){
                    jz = 10 * jz + s.charAt(i) - '0';
                }else {
                    bs = jz * bs + s.charAt(i) - '0';
                }
            }
            list.add(bs);
            list1.add(s);
        }
        int count = 0;
        HashMap<Integer, Integer> map = new HashMap<>();
        for (int i = 0; i < list.size(); i++){
            if (! map.containsKey(list.get(i))){
                map.put(list.get(i), 1);
            }else {
                map.put(list.get(i), map.get(list.get(i)) + 1);
            }
        }
        for (int i = 0; i < list.size(); i++){
            if (map.get(list.get(i)) == 1){
                System.out.println(list1.get(i));
                count ++;
            }
        }
        if (count == 0){
            System.out.println("None");
        }
    }
}
